******************************************
*
*	Article: The Human Costs of the War on Drugs: Attitudes towards Militarization of Security in Mexico
*	Authors: Juan Masullo J., Davide Morisi
*	Journal: Comparative Political Studies
*	Date: 23 March 2023
*
*	This file replicates the following
*	Figure 2 + Figure 4 in main paper
*
*	All analyses performed with Stata/SE 14.2 for Windows
******************************************

*Set working directory
*[my working directory]

*Open Study 1
use "Replication_CPS\Data\study1_recoded.dta", clear

*Append Study 2
append using "Replication_CPS\Data\study2_recoded.dta"
label de group_merged 1"Control" 2"Civilians" 3"Cartel" 4"Conseq. + civilians" 5"Deont. + civilians" 6"Conseq." 7"Deont." 8"No vignette"
label values group group_merged

*Covariates
global demo_st1 "i.female i.agecat i.edu_uni trust_army01 i.city"
global demo_st2 "i.female age10 ib2.ed_level5 trust_army01 i.regions"


*************
*Figure 2: Effects of human costs on support for militarization

*ALL RESPONDENTS
eststo clear
*Study 1 - Model 2 in Table A2
reg dv_att i.group $demo_st1 i.victim_cartel if study==1
eststo Study_1: margins, dydx(2.group 3.group) post
*Study 2 - Model 2 in Table B4
reg dv_att i.group $demo_st2 i.victim_cartel if study==2
eststo Study_2: margins, dydx(2.group 3.group) post
*Study 2 correct - Model 4 in Table B4
reg dv_att i.group##ib1.manip_check $demo_st2 i.victim_cartel if group<8 & study==2
eststo Study_2_correct: margins, dydx(2.group 3.group) at(manip_check=1) post
*graph
coefplot (Study_1, ciopts(lcolor(blue)) mcolor(blue) msymbol(O) msize(medlarge)) ///
(Study_2, ciopts(lcolor(maroon)) mcolor(maroon) msymbol(D) msize(medlarge)) /// 
(Study_2_correct, ciopts(lcolor(orange)) mcolor(orange) msymbol(T) msize(medlarge)), /// 
vertical yline(0, lpattern(dash) lcolor(gs10)) ytitle("Effects on support for militarization") ///
yscale(range(-.30(.05).30)) ylabel(-.30(.05).30) ///
xtitle("Human costs") ///
levels(90 95) graphregion(color(white)) name(figure2A, replace) scheme(default) title("All respondents")

*NON-VICTIMS
eststo clear
*Study 1
reg dv_att i.group##i.victim_cartel $demo_st1  if study==1
eststo Study_1: margins, dydx(2.group 3.group) at(victim_cartel==0) post
*Study 2
reg dv_att i.group##i.victim_cartel $demo_st2  if study==2
eststo Study_2: margins, dydx(2.group 3.group) at(victim_cartel==0) post
*Study 2 correct
reg dv_att i.group##ib1.manip_check##i.victim_cartel $demo_st2  if group<8 & study==2
eststo Study_2_correct: margins, dydx(2.group 3.group) at(manip_check=1 victim_cartel==0) post
*graph
coefplot (Study_1, ciopts(lcolor(blue)) mcolor(blue) msymbol(O) msize(medlarge)) ///
(Study_2, ciopts(lcolor(maroon)) mcolor(maroon) msymbol(D) msize(medlarge)) /// 
(Study_2_correct, ciopts(lcolor(orange)) mcolor(orange) msymbol(T) msize(medlarge)), /// 
vertical yline(0, lpattern(dash) lcolor(gs10)) ytitle("") ///
yscale(range(-.30(.05).30)) ylabel(-.30(.05).30) ///
xtitle("Human costs") ///
levels(90 95) graphregion(color(white)) name(figure2B, replace) scheme(default) title("Non-victims")

*VICTIMS
eststo clear
*Study 1
reg dv_att i.group##i.victim_cartel $demo_st1  if study==1
eststo Study_1: margins, dydx(2.group 3.group) at(victim_cartel==1) post
*Study 2
reg dv_att i.group##i.victim_cartel $demo_st2  if study==2
eststo Study_2: margins, dydx(2.group 3.group) at(victim_cartel==1) post
*Study 2 correct
reg dv_att i.group##ib1.manip_check##i.victim_cartel $demo_st2  if group<8 & study==2
eststo Study_2_correct: margins, dydx(2.group 3.group) at(manip_check=1 victim_cartel==1) post
*graph
coefplot (Study_1, ciopts(lcolor(blue)) mcolor(blue) msymbol(O) msize(medlarge)) ///
(Study_2, ciopts(lcolor(maroon)) mcolor(maroon) msymbol(D) msize(medlarge)) /// 
(Study_2_correct, ciopts(lcolor(orange)) mcolor(orange) msymbol(T) msize(medlarge)), /// 
vertical yline(0, lpattern(dash) lcolor(gs10)) ytitle("") ///
yscale(range(-.30(.05).30)) ylabel(-.30(.05).30) ///
xtitle("Human costs") ///
levels(90 95) graphregion(color(white)) name(figure2C, replace) scheme(default) title("Victims")

*Final figure
graph combine figure2A figure2B figure2C, graphregion(color(white))


*************
*Figure 4: Effects of consequentialist and deontological arguments

*ALL RESPONDENTS
eststo clear
*Study 1 - Model 2 in Table A2
reg dv_att ib2.group $demo_st1 i.victim_cartel if study==1
eststo Study_1: margins, dydx(4.group 5.group) post
*Study 2 - Model 2 in Table B4
reg dv_att ib2.group $demo_st2 i.victim_cartel if study==2
eststo Study_2: margins, dydx(4.group 5.group) post
*Study 2 correct - Model 4 in Table B4
reg dv_att ib2.group##ib1.manip_check $demo_st2 i.victim_cartel if group<8 & study==2
eststo Study_2_correct: margins, dydx(4.group 5.group) at(manip_check=1) post
*graph
coefplot (Study_1, ciopts(lcolor(blue)) mcolor(blue) msymbol(O) msize(medlarge)) ///
(Study_2, ciopts(lcolor(maroon)) mcolor(maroon) msymbol(D) msize(medlarge)) /// 
(Study_2_correct, ciopts(lcolor(orange)) mcolor(orange) msymbol(T) msize(medlarge)), /// 
vertical yline(0, lpattern(dash) lcolor(gs10)) ytitle("Effects on support for militarization") ///
levels(90 95) graphregion(color(white)) name(figure4, replace) scheme(default)

yscale(range(-.30(.05).30)) ylabel(-.30(.05).30) ///
xtitle("Human costs") ///


